#ifndef __Car_H__
#define __Car_H__

#include <OIS.h>
#include <Ogre.h>
#include <btBulletDynamicsCommon.h>
#include <vector>

#include "tinyxml/tinyxml.h"

#include "Actor.h"
#include "BtOgre/BtOgrePG.h"
#include "BtOgre/BtOgreGP.h"
#include "BtOgre/BtOgreExtras.h"
#include "BulletCollision/CollisionDispatch/btGhostObject.h"
#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
//#include "IProjectShadow.h"

using namespace Ogre;

class Car : public Actor
{
public:
	Real mass;

	Real throttle;
	Real steering;
	Real brakes;

	Real engineMax;
	Real brakeForce;
	Real steerLimit;

	Real engineIncrement;
	Real brakeIncrement;
	Real steeringIncrement;

	
	btRaycastVehicle* vehicle;
	btVehicleRaycaster* vehicleRayCaster;
	btRaycastVehicle::btVehicleTuning tuning;

	std::vector<SceneNode*> wheelNodes;
	
	ParticleSystem* wheelParticles;
//	std::vector<ParticleEmitter*> wheelEmitters;
//	Light* headLight;
//	Light* backLight;

	bool frameStarted(const Ogre::FrameEvent &evt);
	bool frameEnded(const Ogre::FrameEvent &evt);

//    virtual void init(Ogre::Root*);
	virtual void init(Ogre::Root* OgreRoot, SceneManager*);
	void init(Ogre::Root*, SceneManager* sceneMgr, btDiscreteDynamicsWorld*, String);
//    void init(Ogre::Root*, SceneManager* sceneMgr, btDynamicsWorld*, String);
	void Fire();

	Car(SceneManager*);
	virtual ~Car();

protected:
//    btDynamicsWorld* phyWorld;
	btDiscreteDynamicsWorld* phyWorld;
	Ogre::Root *mRoot;
	Ogre::SceneManager* mSceneMgr;

};
#endif
